# -*- coding: UTF-8 -*-
# @Time : 2022-02-15 23:24
# @User：My.
# @File : Allure_Report.py
import subprocess
from Utils.LogUtil import my_log
from Conf import conf
import os
log = my_log('Allure_Report')


def allure_generate(report_path, report_html):
    allure_cmd = 'allure generate %s -o %s --clean'%(report_path, report_html)
    log.info('报告地址：{0}'.format(conf.current + os.sep + report_path))
    try:
        subprocess.call(allure_cmd, shell=True)
        log.info('报告地址：{0}'.format(conf.current + os.sep + report_html))
    except Exception as e:
        log.error('生成报告失败！')
        raise e